package com.icart.entities;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

@Entity
@Table(name = "cu_coupon", schema = "ams", catalog = "")
public class CuCouponEntity {
    private long cpid;
    private String cpcode;
    private String feeobj;
    private Long feeobjid;
    private long treeid;
    private String feecaltype;
    private BigDecimal feeval;
    private String remark;
    private Timestamp startdate;
    private Timestamp enddate;
    private Long usechn;
    private BigDecimal ordamount;

    @Id
    @Column(name = "cpid")
    public long getCpid() {
        return cpid;
    }

    public void setCpid(long cpid) {
        this.cpid = cpid;
    }

    @Basic
    @Column(name = "cpcode")
    public String getCpcode() {
        return cpcode;
    }

    public void setCpcode(String cpcode) {
        this.cpcode = cpcode;
    }

    @Basic
    @Column(name = "feeobj")
    public String getFeeobj() {
        return feeobj;
    }

    public void setFeeobj(String feeobj) {
        this.feeobj = feeobj;
    }

    @Basic
    @Column(name = "feeobjid")
    public Long getFeeobjid() {
        return feeobjid;
    }

    public void setFeeobjid(Long feeobjid) {
        this.feeobjid = feeobjid;
    }

    @Basic
    @Column(name = "treeid")
    public long getTreeid() {
        return treeid;
    }

    public void setTreeid(long treeid) {
        this.treeid = treeid;
    }

    @Basic
    @Column(name = "feecaltype")
    public String getFeecaltype() {
        return feecaltype;
    }

    public void setFeecaltype(String feecaltype) {
        this.feecaltype = feecaltype;
    }

    @Basic
    @Column(name = "feeval")
    public BigDecimal getFeeval() {
        return feeval;
    }

    public void setFeeval(BigDecimal feeval) {
        this.feeval = feeval;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "startdate")
    public Timestamp getStartdate() {
        return startdate;
    }

    public void setStartdate(Timestamp startdate) {
        this.startdate = startdate;
    }

    @Basic
    @Column(name = "enddate")
    public Timestamp getEnddate() {
        return enddate;
    }

    public void setEnddate(Timestamp enddate) {
        this.enddate = enddate;
    }

    @Basic
    @Column(name = "usechn")
    public Long getUsechn() {
        return usechn;
    }

    public void setUsechn(Long usechn) {
        this.usechn = usechn;
    }

    @Basic
    @Column(name = "ordamount")
    public BigDecimal getOrdamount() {
        return ordamount;
    }

    public void setOrdamount(BigDecimal ordamount) {
        this.ordamount = ordamount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CuCouponEntity that = (CuCouponEntity) o;

        if (cpid != that.cpid) return false;
        if (treeid != that.treeid) return false;
        if (cpcode != null ? !cpcode.equals(that.cpcode) : that.cpcode != null) return false;
        if (feeobj != null ? !feeobj.equals(that.feeobj) : that.feeobj != null) return false;
        if (feeobjid != null ? !feeobjid.equals(that.feeobjid) : that.feeobjid != null) return false;
        if (feecaltype != null ? !feecaltype.equals(that.feecaltype) : that.feecaltype != null) return false;
        if (feeval != null ? !feeval.equals(that.feeval) : that.feeval != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (startdate != null ? !startdate.equals(that.startdate) : that.startdate != null) return false;
        if (enddate != null ? !enddate.equals(that.enddate) : that.enddate != null) return false;
        if (usechn != null ? !usechn.equals(that.usechn) : that.usechn != null) return false;
        if (ordamount != null ? !ordamount.equals(that.ordamount) : that.ordamount != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (cpid ^ (cpid >>> 32));
        result = 31 * result + (cpcode != null ? cpcode.hashCode() : 0);
        result = 31 * result + (feeobj != null ? feeobj.hashCode() : 0);
        result = 31 * result + (feeobjid != null ? feeobjid.hashCode() : 0);
        result = 31 * result + (int) (treeid ^ (treeid >>> 32));
        result = 31 * result + (feecaltype != null ? feecaltype.hashCode() : 0);
        result = 31 * result + (feeval != null ? feeval.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (startdate != null ? startdate.hashCode() : 0);
        result = 31 * result + (enddate != null ? enddate.hashCode() : 0);
        result = 31 * result + (usechn != null ? usechn.hashCode() : 0);
        result = 31 * result + (ordamount != null ? ordamount.hashCode() : 0);
        return result;
    }
}
